package pkgs

import (
	"net/http"
)

func service3(w http.ResponseWriter, r *http.Request) {
	var err error
	w.WriteHeader(200)
	_, err = w.Write([]byte("Hello Http!"))
	if err != nil {
		w.Write([]byte("error"))
		w.WriteHeader(500)
		return
	}
	return
}

func SetupHttp() {
	http.Handle("/http-service1", http.HandlerFunc(service3))
	err := http.ListenAndServe("0.0.0.0:9000", nil)
	if err != nil {
		panic(err)
	}
}
